﻿namespace UnitTestInjector
{
    #region Usings

    using Exceptions;
    using System;

    #endregion Usings

    internal class UnitTestInjectorAssert
    {
        public static void IsInstanceOfType<T>(object value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }

            var type = typeof(T);

            if (type.IsInstanceOfType(value)) return;

            throw new IsInstanceOfTypeAssertionFailedException(type, value);
        }

        public static void AreEqual(object value1, object value2)
        {
            if (Equals(value1, value2)) return;
            throw new AreEqualAssertionFailedException(value1, value2);
        }

        internal static void IsNotNull(object value)
        {
            if (value != null) return;
            throw new IsNotNullAssertionFailedException();
        }
    }
}